﻿using System.Threading.Tasks;
using LiJ.Common.Core;
using LiJ.Orm;
using Sample.Test.Models;

namespace Sample.Test.DAO
{
    public class SampleRepository : BaseRepository, ISampleRepository
    {
        /// <summary>
        /// 构造函数给定数据库表名
        /// </summary>
        public SampleRepository()
        {
            SourceTableName = "Sample";
        }

        /// <summary>
        /// 查询所有数据
        /// </summary>
        /// <returns></returns>
        public async Task<PageListMo<SampleModel>> GetList()
        {
            return await GetList<SampleModel>($"select * from {SourceTableName}",
                $"select count(1) from {SourceTableName}", null);
        }
    }
}